3.308 \(\int \frac{(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{\sqrt{a+a \sin (e+f x)}} \, dx\)

Optimal. Leaf size=200 \[ -\frac{4 \left (5 A d (3 c-d)+B \left (6 c^2-7 c d+7 d^2\right )\right ) \cos (e+f x)}{15 f \sqrt{a \sin (e+f x)+a}}-\frac{2 d (5 A d+4 B c-B d) \cos (e+f x) \sqrt{a \sin (e+f x)+a}}{15 a f}-\frac{\sqrt{2} (A-B) (c-d)^2 \tanh ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{2} \sqrt{a \sin (e+f x)+a}}\right )}{\sqrt{a} f}-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a \sin (e+f x)+a}} \]

[Out]

-((Sqrt[2]*(A - B)*(c - d)^2*ArcTanh[(Sqrt[a]*Cos[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sin[e + f*x]])])/(Sqrt[a]*f))
- (4*(5*A*(3*c - d)*d + B*(6*c^2 - 7*c*d + 7*d^2))*Cos[e + f*x])/(15*f*Sqrt[a + a*Sin[e + f*x]]) - (2*d*(4*B*c
 + 5*A*d - B*d)*Cos[e + f*x]*Sqrt[a + a*Sin[e + f*x]])/(15*a*f) - (2*B*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(5
*f*Sqrt[a + a*Sin[e + f*x]])

________________________________________________________________________________________

Rubi [A]  time = 0.584511, antiderivative size = 200, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 37, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.162, Rules used = {2983, 2968, 3023, 2751, 2649, 206} \[ -\frac{4 \left (5 A d (3 c-d)+B \left (6 c^2-7 c d+7 d^2\right )\right ) \cos (e+f x)}{15 f \sqrt{a \sin (e+f x)+a}}-\frac{2 d (5 A d+4 B c-B d) \cos (e+f x) \sqrt{a \sin (e+f x)+a}}{15 a f}-\frac{\sqrt{2} (A-B) (c-d)^2 \tanh ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{2} \sqrt{a \sin (e+f x)+a}}\right )}{\sqrt{a} f}-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a \sin (e+f x)+a}} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

-((Sqrt[2]*(A - B)*(c - d)^2*ArcTanh[(Sqrt[a]*Cos[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sin[e + f*x]])])/(Sqrt[a]*f))
- (4*(5*A*(3*c - d)*d + B*(6*c^2 - 7*c*d + 7*d^2))*Cos[e + f*x])/(15*f*Sqrt[a + a*Sin[e + f*x]]) - (2*d*(4*B*c
 + 5*A*d - B*d)*Cos[e + f*x]*Sqrt[a + a*Sin[e + f*x]])/(15*a*f) - (2*B*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(5
*f*Sqrt[a + a*Sin[e + f*x]])

Rule 2983

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> -Simp[(B*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n)/(f*(
m + n + 1)), x] + Dist[1/(b*(m + n + 1)), Int[(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^(n - 1)*Simp[A*b*c*(
m + n + 1) + B*(a*c*m + b*d*n) + (A*b*d*(m + n + 1) + B*(a*d*m + b*c*n))*Sin[e + f*x], x], x], x] /; FreeQ[{a,
 b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[n, 0] && (I
ntegerQ[n] || EqQ[m + 1/2, 0])

Rule 2968

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 2751

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(d
*Cos[e + f*x]*(a + b*Sin[e + f*x])^m)/(f*(m + 1)), x] + Dist[(a*d*m + b*c*(m + 1))/(b*(m + 1)), Int[(a + b*Sin
[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] &&  !LtQ[m,
-2^(-1)]

Rule 2649

Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[-2/d, Subst[Int[1/(2*a - x^2), x], x, (b*C
os[c + d*x])/Sqrt[a + b*Sin[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{\sqrt{a+a \sin (e+f x)}} \, dx &=-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a+a \sin (e+f x)}}+\frac{2 \int \frac{(c+d \sin (e+f x)) \left (\frac{1}{2} a (5 A c-B c+4 B d)+\frac{1}{2} a (4 B c+5 A d-B d) \sin (e+f x)\right )}{\sqrt{a+a \sin (e+f x)}} \, dx}{5 a}\\ &=-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a+a \sin (e+f x)}}+\frac{2 \int \frac{\frac{1}{2} a c (5 A c-B c+4 B d)+\left (\frac{1}{2} a c (4 B c+5 A d-B d)+\frac{1}{2} a d (5 A c-B c+4 B d)\right ) \sin (e+f x)+\frac{1}{2} a d (4 B c+5 A d-B d) \sin ^2(e+f x)}{\sqrt{a+a \sin (e+f x)}} \, dx}{5 a}\\ &=-\frac{2 d (4 B c+5 A d-B d) \cos (e+f x) \sqrt{a+a \sin (e+f x)}}{15 a f}-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a+a \sin (e+f x)}}+\frac{4 \int \frac{\frac{1}{4} a^2 \left (5 A \left (3 c^2+d^2\right )-B \left (3 c^2-16 c d+d^2\right )\right )+\frac{1}{2} a^2 \left (5 A (3 c-d) d+B \left (6 c^2-7 c d+7 d^2\right )\right ) \sin (e+f x)}{\sqrt{a+a \sin (e+f x)}} \, dx}{15 a^2}\\ &=-\frac{4 \left (5 A (3 c-d) d+B \left (6 c^2-7 c d+7 d^2\right )\right ) \cos (e+f x)}{15 f \sqrt{a+a \sin (e+f x)}}-\frac{2 d (4 B c+5 A d-B d) \cos (e+f x) \sqrt{a+a \sin (e+f x)}}{15 a f}-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a+a \sin (e+f x)}}+\left ((A-B) (c-d)^2\right ) \int \frac{1}{\sqrt{a+a \sin (e+f x)}} \, dx\\ &=-\frac{4 \left (5 A (3 c-d) d+B \left (6 c^2-7 c d+7 d^2\right )\right ) \cos (e+f x)}{15 f \sqrt{a+a \sin (e+f x)}}-\frac{2 d (4 B c+5 A d-B d) \cos (e+f x) \sqrt{a+a \sin (e+f x)}}{15 a f}-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a+a \sin (e+f x)}}-\frac{\left (2 (A-B) (c-d)^2\right ) \operatorname{Subst}\left (\int \frac{1}{2 a-x^2} \, dx,x,\frac{a \cos (e+f x)}{\sqrt{a+a \sin (e+f x)}}\right )}{f}\\ &=-\frac{\sqrt{2} (A-B) (c-d)^2 \tanh ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{2} \sqrt{a+a \sin (e+f x)}}\right )}{\sqrt{a} f}-\frac{4 \left (5 A (3 c-d) d+B \left (6 c^2-7 c d+7 d^2\right )\right ) \cos (e+f x)}{15 f \sqrt{a+a \sin (e+f x)}}-\frac{2 d (4 B c+5 A d-B d) \cos (e+f x) \sqrt{a+a \sin (e+f x)}}{15 a f}-\frac{2 B \cos (e+f x) (c+d \sin (e+f x))^2}{5 f \sqrt{a+a \sin (e+f x)}}\\ \end{align*}

Mathematica [C]  time = 0.528206, size = 246, normalized size = 1.23 \[ \frac{\left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right ) \left (30 \left (A d (4 c-d)+2 B \left (c^2-c d+d^2\right )\right ) \sin \left (\frac{1}{2} (e+f x)\right )-30 \left (A d (4 c-d)+2 B \left (c^2-c d+d^2\right )\right ) \cos \left (\frac{1}{2} (e+f x)\right )+5 d (B (d-4 c)-2 A d) \sin \left (\frac{3}{2} (e+f x)\right )+5 d (B (d-4 c)-2 A d) \cos \left (\frac{3}{2} (e+f x)\right )+(60+60 i) (-1)^{3/4} (A-B) (c-d)^2 \tanh ^{-1}\left (\left (\frac{1}{2}+\frac{i}{2}\right ) (-1)^{3/4} \left (\tan \left (\frac{1}{4} (e+f x)\right )-1\right )\right )-3 B d^2 \sin \left (\frac{5}{2} (e+f x)\right )+3 B d^2 \cos \left (\frac{5}{2} (e+f x)\right )\right )}{30 f \sqrt{a (\sin (e+f x)+1)}} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*((60 + 60*I)*(-1)^(3/4)*(A - B)*(c - d)^2*ArcTanh[(1/2 + I/2)*(-1)^(3/4
)*(-1 + Tan[(e + f*x)/4])] - 30*(A*(4*c - d)*d + 2*B*(c^2 - c*d + d^2))*Cos[(e + f*x)/2] + 5*d*(-2*A*d + B*(-4
*c + d))*Cos[(3*(e + f*x))/2] + 3*B*d^2*Cos[(5*(e + f*x))/2] + 30*(A*(4*c - d)*d + 2*B*(c^2 - c*d + d^2))*Sin[
(e + f*x)/2] + 5*d*(-2*A*d + B*(-4*c + d))*Sin[(3*(e + f*x))/2] - 3*B*d^2*Sin[(5*(e + f*x))/2]))/(30*f*Sqrt[a*
(1 + Sin[e + f*x])])

________________________________________________________________________________________

Maple [B]  time = 1.362, size = 396, normalized size = 2. \begin{align*} -{\frac{1+\sin \left ( fx+e \right ) }{15\,{a}^{3}\cos \left ( fx+e \right ) f}\sqrt{-a \left ( -1+\sin \left ( fx+e \right ) \right ) } \left ( 15\,A{a}^{5/2}\sqrt{2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{a-a\sin \left ( fx+e \right ) }\sqrt{2}}{\sqrt{a}}} \right ){c}^{2}-30\,A{a}^{5/2}\sqrt{2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{a-a\sin \left ( fx+e \right ) }\sqrt{2}}{\sqrt{a}}} \right ) cd+15\,A{a}^{5/2}\sqrt{2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{a-a\sin \left ( fx+e \right ) }\sqrt{2}}{\sqrt{a}}} \right ){d}^{2}-15\,B{a}^{5/2}\sqrt{2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{a-a\sin \left ( fx+e \right ) }\sqrt{2}}{\sqrt{a}}} \right ){c}^{2}+30\,B{a}^{5/2}\sqrt{2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{a-a\sin \left ( fx+e \right ) }\sqrt{2}}{\sqrt{a}}} \right ) cd-15\,B{a}^{5/2}\sqrt{2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{a-a\sin \left ( fx+e \right ) }\sqrt{2}}{\sqrt{a}}} \right ){d}^{2}+6\,B \left ( a-a\sin \left ( fx+e \right ) \right ) ^{5/2}{d}^{2}-10\,A \left ( a-a\sin \left ( fx+e \right ) \right ) ^{3/2}a{d}^{2}-20\,B \left ( a-a\sin \left ( fx+e \right ) \right ) ^{3/2}acd-10\,B \left ( a-a\sin \left ( fx+e \right ) \right ) ^{3/2}a{d}^{2}+60\,A{a}^{2}cd\sqrt{a-a\sin \left ( fx+e \right ) }+30\,B{a}^{2}{c}^{2}\sqrt{a-a\sin \left ( fx+e \right ) }+30\,{a}^{2}B{d}^{2}\sqrt{a-a\sin \left ( fx+e \right ) } \right ){\frac{1}{\sqrt{a+a\sin \left ( fx+e \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x)

[Out]

-1/15*(1+sin(f*x+e))*(-a*(-1+sin(f*x+e)))^(1/2)*(15*A*a^(5/2)*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/
2)/a^(1/2))*c^2-30*A*a^(5/2)*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*c*d+15*A*a^(5/2)*2^(1
/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*d^2-15*B*a^(5/2)*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^
(1/2)*2^(1/2)/a^(1/2))*c^2+30*B*a^(5/2)*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*c*d-15*B*a
^(5/2)*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*d^2+6*B*(a-a*sin(f*x+e))^(5/2)*d^2-10*A*(a-
a*sin(f*x+e))^(3/2)*a*d^2-20*B*(a-a*sin(f*x+e))^(3/2)*a*c*d-10*B*(a-a*sin(f*x+e))^(3/2)*a*d^2+60*A*a^2*c*d*(a-
a*sin(f*x+e))^(1/2)+30*B*a^2*c^2*(a-a*sin(f*x+e))^(1/2)+30*a^2*B*d^2*(a-a*sin(f*x+e))^(1/2))/a^3/cos(f*x+e)/(a
+a*sin(f*x+e))^(1/2)/f

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \sin \left (f x + e\right ) + A\right )}{\left (d \sin \left (f x + e\right ) + c\right )}^{2}}{\sqrt{a \sin \left (f x + e\right ) + a}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate((B*sin(f*x + e) + A)*(d*sin(f*x + e) + c)^2/sqrt(a*sin(f*x + e) + a), x)

________________________________________________________________________________________

Fricas [B]  time = 1.8325, size = 1119, normalized size = 5.6 \begin{align*} -\frac{\frac{15 \, \sqrt{2}{\left ({\left (A - B\right )} a c^{2} - 2 \,{\left (A - B\right )} a c d +{\left (A - B\right )} a d^{2} +{\left ({\left (A - B\right )} a c^{2} - 2 \,{\left (A - B\right )} a c d +{\left (A - B\right )} a d^{2}\right )} \cos \left (f x + e\right ) +{\left ({\left (A - B\right )} a c^{2} - 2 \,{\left (A - B\right )} a c d +{\left (A - B\right )} a d^{2}\right )} \sin \left (f x + e\right )\right )} \log \left (-\frac{\cos \left (f x + e\right )^{2} -{\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) + \frac{2 \, \sqrt{2} \sqrt{a \sin \left (f x + e\right ) + a}{\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{\sqrt{a}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} -{\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt{a}} - 4 \,{\left (3 \, B d^{2} \cos \left (f x + e\right )^{3} - 15 \, B c^{2} - 10 \,{\left (3 \, A - 2 \, B\right )} c d +{\left (10 \, A - 17 \, B\right )} d^{2} -{\left (10 \, B c d +{\left (5 \, A - 4 \, B\right )} d^{2}\right )} \cos \left (f x + e\right )^{2} -{\left (15 \, B c^{2} + 10 \,{\left (3 \, A - B\right )} c d -{\left (5 \, A - 16 \, B\right )} d^{2}\right )} \cos \left (f x + e\right ) -{\left (3 \, B d^{2} \cos \left (f x + e\right )^{2} - 15 \, B c^{2} - 10 \,{\left (3 \, A - 2 \, B\right )} c d +{\left (10 \, A - 17 \, B\right )} d^{2} +{\left (10 \, B c d +{\left (5 \, A - B\right )} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )\right )} \sqrt{a \sin \left (f x + e\right ) + a}}{30 \,{\left (a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

-1/30*(15*sqrt(2)*((A - B)*a*c^2 - 2*(A - B)*a*c*d + (A - B)*a*d^2 + ((A - B)*a*c^2 - 2*(A - B)*a*c*d + (A - B
)*a*d^2)*cos(f*x + e) + ((A - B)*a*c^2 - 2*(A - B)*a*c*d + (A - B)*a*d^2)*sin(f*x + e))*log(-(cos(f*x + e)^2 -
 (cos(f*x + e) - 2)*sin(f*x + e) + 2*sqrt(2)*sqrt(a*sin(f*x + e) + a)*(cos(f*x + e) - sin(f*x + e) + 1)/sqrt(a
) + 3*cos(f*x + e) + 2)/(cos(f*x + e)^2 - (cos(f*x + e) + 2)*sin(f*x + e) - cos(f*x + e) - 2))/sqrt(a) - 4*(3*
B*d^2*cos(f*x + e)^3 - 15*B*c^2 - 10*(3*A - 2*B)*c*d + (10*A - 17*B)*d^2 - (10*B*c*d + (5*A - 4*B)*d^2)*cos(f*
x + e)^2 - (15*B*c^2 + 10*(3*A - B)*c*d - (5*A - 16*B)*d^2)*cos(f*x + e) - (3*B*d^2*cos(f*x + e)^2 - 15*B*c^2
- 10*(3*A - 2*B)*c*d + (10*A - 17*B)*d^2 + (10*B*c*d + (5*A - B)*d^2)*cos(f*x + e))*sin(f*x + e))*sqrt(a*sin(f
*x + e) + a))/(a*f*cos(f*x + e) + a*f*sin(f*x + e) + a*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))**2/(a+a*sin(f*x+e))**(1/2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.81207, size = 1494, normalized size = 7.47 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

1/60*(120*sqrt(2)*(A*c^2 - B*c^2 - 2*A*c*d + 2*B*c*d + A*d^2 - B*d^2)*arctan(-1/2*sqrt(2)*(sqrt(a)*tan(1/2*f*x
 + 1/2*e) - sqrt(a*tan(1/2*f*x + 1/2*e)^2 + a) + sqrt(a))/sqrt(-a))/(sqrt(-a)*sgn(tan(1/2*f*x + 1/2*e) + 1)) +
 ((((((15*B*a^2*c^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + 30*A*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - 10*B*a^2*c*d*
sgn(tan(1/2*f*x + 1/2*e) + 1) - 5*A*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + 13*B*a^2*d^2*sgn(tan(1/2*f*x + 1/2
*e) + 1))*tan(1/2*f*x + 1/2*e)/a^9 - 15*(B*a^2*c^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + 2*A*a^2*c*d*sgn(tan(1/2*f*x
 + 1/2*e) + 1) - 2*B*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - A*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + B*a^2*d
^2*sgn(tan(1/2*f*x + 1/2*e) + 1))/a^9)*tan(1/2*f*x + 1/2*e) + 10*(3*B*a^2*c^2*sgn(tan(1/2*f*x + 1/2*e) + 1) +
6*A*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - 4*B*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - 2*A*a^2*d^2*sgn(tan(1/
2*f*x + 1/2*e) + 1) + 4*B*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1))/a^9)*tan(1/2*f*x + 1/2*e) - 10*(3*B*a^2*c^2*s
gn(tan(1/2*f*x + 1/2*e) + 1) + 6*A*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - 4*B*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e
) + 1) - 2*A*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + 4*B*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1))/a^9)*tan(1/2*f
*x + 1/2*e) + 15*(B*a^2*c^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + 2*A*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - 2*B*a^
2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - A*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + B*a^2*d^2*sgn(tan(1/2*f*x + 1/
2*e) + 1))/a^9)*tan(1/2*f*x + 1/2*e) - (15*B*a^2*c^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + 30*A*a^2*c*d*sgn(tan(1/2*
f*x + 1/2*e) + 1) - 10*B*a^2*c*d*sgn(tan(1/2*f*x + 1/2*e) + 1) - 5*A*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1) + 1
3*B*a^2*d^2*sgn(tan(1/2*f*x + 1/2*e) + 1))/a^9)/(a*tan(1/2*f*x + 1/2*e)^2 + a)^(5/2) - (120*sqrt(2)*A*a^10*c^2
*arctan(sqrt(a)/sqrt(-a)) - 120*sqrt(2)*B*a^10*c^2*arctan(sqrt(a)/sqrt(-a)) - 240*sqrt(2)*A*a^10*c*d*arctan(sq
rt(a)/sqrt(-a)) + 240*sqrt(2)*B*a^10*c*d*arctan(sqrt(a)/sqrt(-a)) + 120*sqrt(2)*A*a^10*d^2*arctan(sqrt(a)/sqrt
(-a)) - 120*sqrt(2)*B*a^10*d^2*arctan(sqrt(a)/sqrt(-a)) - 15*sqrt(2)*B*sqrt(-a)*sqrt(a)*c^2 - 30*sqrt(2)*A*sqr
t(-a)*sqrt(a)*c*d + 20*sqrt(2)*B*sqrt(-a)*sqrt(a)*c*d + 10*sqrt(2)*A*sqrt(-a)*sqrt(a)*d^2 - 17*sqrt(2)*B*sqrt(
-a)*sqrt(a)*d^2)*sgn(tan(1/2*f*x + 1/2*e) + 1)/(sqrt(-a)*a^10))/f